extends StaticBody

onready var sounds = get_tree().get_current_scene().get_node("Sounds")
onready var mesh_instance : MeshInstance = get_node("Stair_Element/Stair_Element")
#onready var jumped_material : Material = preload("res://assets/materials/stair_element_jumped_material.material")
#onready var normal_material : Material = preload("res://assets/materials/Stairs.material")
#onready var normal_material : Material = preload("res://assets/materials/stair_blue.material")

func _on_Area_area_entered(area):
	return
	sounds.landing_play()
#	mesh_instance.material_override(jumped_material)
	var globalGame = get_tree().get_current_scene()
	mesh_instance.set_surface_material(0,globalGame.stair_jump_mater)
#	mesh_instance.mesh.surface_set_material(0,jumped_material)


func _on_Area_area_exited(area):
	return
#	pass
#	mesh_instance.mesh.surface_set_material(0,normal_material)
	var globalGame = get_tree().get_current_scene()
	mesh_instance.set_surface_material(0,globalGame.stair_normal_material)
#	mesh_instance.material_override(normal_material)

func stair_explosion_sound():
	sounds.stair_explosion_play()
